B17 - Frog 1 with Restoration
提出
code: python
n = int(input())
h = list(map(int, input().split()))
for i in range(2, n):
h.sort()
# 20,40,30,10
dp.sort()
# 30,30,20,0
for now in range(n-2, -1, -1):
if now == 0:
break
else:
解答
code: python
n = int(input())
h = list(map(int, input().split()))
for i in range(2, n):
# print(h)
# print(dp)
ans = []
p = n-1
while True:
ans.append(p + 1)
if p == 0:
break
# どこから部屋 p に向かうのが最適かを求める
p = p - 1
p = p - 2
ans.reverse()
print(len(ans))
print(" ".join(ans2))